package com.hongning.railway.entity.resbean;

import android.os.Parcel;
import android.os.Parcelable;

import com.hongning.railway.R;

public class NewsCategoryBean implements Parcelable {

    /**
     * id : 100002
     * name : 集团新闻
     */

    private int id;
    private String name;
    private int resId;

    public int getResId() {
        return resId;
    }

    public void setResId(int resId) {
        this.resId = resId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    /**
     * sb后台不肯返回来 只有根据id来筛选
     * @return
     */
    public int getDrawableId(){
        switch (id){
            case 100001:
                return R.mipmap.menu_dang;
            case 100002:
                return R.mipmap.menu_jituan;
            case 100003:
                return R.mipmap.menu_gongsi;
            case 100004:
                return R.mipmap.menu_news;
            case 100005:
                return R.mipmap.menu_qiye;
            case 100006:
                return R.mipmap.menu_fagui;
            case 100007:
                return R.mipmap.menu_fanfu;
            case 100008:
                return R.mipmap.menu_zhuanti;
        }
        return R.mipmap.menu_news;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeInt(this.resId);
    }

    public NewsCategoryBean() {
    }

    protected NewsCategoryBean(Parcel in) {
        this.id = in.readInt();
        this.name = in.readString();
        this.resId = in.readInt();
    }

    public static final Parcelable.Creator<NewsCategoryBean> CREATOR = new Parcelable.Creator<NewsCategoryBean>() {
        @Override
        public NewsCategoryBean createFromParcel(Parcel source) {
            return new NewsCategoryBean(source);
        }

        @Override
        public NewsCategoryBean[] newArray(int size) {
            return new NewsCategoryBean[size];
        }
    };
}
